//
// Created by Administrator on 24-9-14.
//

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include<QWidget>
#include<QSerialPort>
#include<QSerialPortInfo>
#include "receiver.h"
#include  <QThread>
#include <QTimer>
#include "mfmcustomplot.h"
QT_BEGIN_NAMESPACE

namespace Ui
{
    class MainWindow;
}

QT_END_NAMESPACE

class MainWindow : public QWidget
{
    Q_OBJECT

public:
    void initPlot(QCustomPlot * q,int xCount);
    explicit MainWindow(QWidget* parent = nullptr);
    ~MainWindow() override;
    void open();
    void changePushButton(bool);
signals:
    void clear(int i);
    void openS(QString s);
    void closeS();
    void  changeAB(double a,double b,int index);

private:
    Ui::MainWindow* ui;
    Receiver* rec;
    QThread* thread;
    QTimer* timer;
    QTimer* timer2;
    int count = 0;
    int closeCount = 0;
    bool isOpen = false;
    QByteArray serialData;
    QTimer *timerForStartAutoXY;
    void changeXY();
};


#endif //MAINWINDOW_H
